#include <stdio.h>
#include <stdlib.h>

/*
* =================================================
*    Filename:  .c
* Description:
*     Created:  dd/mm/18 hh:mm
* =================================================
*/

int main(int argc, char **argv)
{
	int num, count = 0;
	char a;
	do
	{
		scanf("%c", &a);
		if(a == 'a') count++;
	}while(a != '\n');
	printf("%d\n", count);
    return 0;
}

